﻿<phone:PhoneApplicationPage
    x:Class="ImageProcessingApp.StreamPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:controls="clr-namespace:ImageProcessingApp.Controls"
    xmlns:pages="clr-namespace:ImageProcessingApp.Pages"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="False">

    <Grid x:Name="LayoutRoot">
        <Grid.Background>
            <ImageBrush ImageSource="/Assets/Graphics/background.png" Stretch="None"/>
        </Grid.Background>
        
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <Image Source="/Assets/Graphics/title.png" Stretch="None" HorizontalAlignment="Left" Margin="4,0,0,0"/>
        </StackPanel>

        <Grid x:Name="ContentPanel" Grid.Row="1">
            <phone:LongListSelector x:Name="ListBox" ItemsSource="{Binding ListBoxItems}">
                <phone:LongListSelector.ItemTemplate>
                    <DataTemplate>
                        <pages:PhotoMosaicListBoxSelector Content="{Binding}">
                            <pages:PhotoMosaicListBoxSelector.PhotoMosaicTemplate>
                                <DataTemplate>
                                    <controls:PhotoMosaic Margin="24,0,0,0"/>
                                </DataTemplate>
                            </pages:PhotoMosaicListBoxSelector.PhotoMosaicTemplate>
                                <pages:PhotoMosaicListBoxSelector.PhotoMosaicButtonTemplate>
                                <DataTemplate>
                                    <controls:PhotoMosaicButton MaxWidth="430" Margin="12,0,12,0"/>
                                </DataTemplate>
                            </pages:PhotoMosaicListBoxSelector.PhotoMosaicButtonTemplate>
                        </pages:PhotoMosaicListBoxSelector>
                    </DataTemplate>
                </phone:LongListSelector.ItemTemplate>
            </phone:LongListSelector>
        </Grid>

        <ProgressBar x:Name="ProgressBar" VerticalAlignment="Top"
                     Visibility="Collapsed" IsIndeterminate="False"/>
    </Grid>

    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar BackgroundColor="{StaticResource ImageProcessingAppApplicationBarBackgroundColor}"
                              ForegroundColor="{StaticResource ImageProcessingAppApplicationBarForegroundColor}"/>
    </phone:PhoneApplicationPage.ApplicationBar>
</phone:PhoneApplicationPage>